﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EnvironSystem;
using SkillSystem;
using UnityEngine;

public class SpinStrikePartOneEffectCtrl:SkillEffectCtrlBase
{
    public GameObject EffectGo;
    private float time = 0;

    public float edgeTime = 0.2f;

    private void OnEnable()
    {
        time = 0;
    }

    private void Update()
    {
        if (time < edgeTime)
        {
            time += Time.deltaTime;
            if (time >= edgeTime)
            {
                OnDamage();
            }
        }
    }

    public override Dictionary<AreaType, IAreaArgs> GetDamageArea()
    {
        Dictionary<AreaType, IAreaArgs> areas = new Dictionary<AreaType, IAreaArgs>() { { AreaType.Circle, new CircleAreaArgs(this.transform.position, 5) } };
        return areas;
    }

    public override void Refresh()
    {
        EffectGo.SetActive(false);
        EffectGo.SetActive(true);
    }
}